import request from "@/utils/request";

// 用户登录
export function loginApi(data: any) {
  return request({
    url: "api/login",
    method: "post",
    data,
  });
}

// 获取用户信息
export function getUserInfoApi() {
  return request({
    url: "api/me",
    method: "get",
  });
}

// 更新用户信息
export function updateUserInfoApi(data:any) {
  return request({
    url: "api/me",
    method: "put",
    data
  });
}

// 退出登录
export function logoutApi() {
  return request({
    url: "api/logout",
    method: "post",
  });
}

// 确认密码
export function CheckOldPassword(data: any) {
  return request({
    url: "api//me/check-password",
    method: "post",
    data,
  });
}
